package com.cxy.caiapiinterface.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cxy.caiapiinterface.model.dto.post.PostQueryRequest;
import com.cxy.caiapiinterface.model.entity.Post;
import com.cxy.caiapiinterface.service.PostService;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;

import java.util.List;

public class PostServiceImpl implements PostService {

    @Override
    public Page<Post> searchFromEs(PostQueryRequest postQueryRequest) {
        Long id = postQueryRequest.getId();
        Long notId = postQueryRequest.getNotId();
        String searchText = postQueryRequest.getSearchText();
        String title = postQueryRequest.getTitle();
        String content = postQueryRequest.getContent();
        List<String> tagList = postQueryRequest.getTags();
        List<String> orTagList = postQueryRequest.getOrTags();
        Long userId = postQueryRequest.getUserId();
        // es 起始页为 0
        long current = postQueryRequest.getCurrent() - 1;
        long pageSize = postQueryRequest.getPageSize();
        String sortField = postQueryRequest.getSortField();
        String sortOrder = postQueryRequest.getSortOrder();
        BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();

    }
}
